import { Form, Input } from "antd";
import { FC } from "react";
import { questionInfo_propsType } from ".";
const {TextArea} = Input
const PropsComponent:FC<questionInfo_propsType> = (props)=>{
    const {text,title,onchange,islock} = props
    const [form] = Form.useForm()
    const valuechange = ()=>{
        if(onchange){
            onchange(form.getFieldsValue())
        }
    }
    return <Form layout='vertical' form = {form} initialValues={{text,title}} onValuesChange={valuechange} disabled = {islock}>
        <Form.Item name='title' label='标题' >
            <Input/>
        </Form.Item>

        <Form.Item name='text' label='输入框'>
            <TextArea/>
        </Form.Item>
    </Form>
}

export default PropsComponent